<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>コントロールパネル</title>
    
    <link href="./assets/styles/default.css" rel="stylesheet" />
    <script src="./assets/scripts/libs/jquery-1.7.1.min.js" type="text/javascript"></script>
    <script src="./assets/scripts/plugins/jquery.tagsinput.min.js" type="text/javascript"></script>
    <script src="./assets/scripts/import.js" type="text/javascript"></script>  
</head>
<body>

{include file='include/header.inc.html'}

<div id="container">
    <aside id="accordion">
    	<div id="aside_inner">
            {include file='include/menu.inc.html'}
        </div>
    </aside>
    
    <article>
    	<h2><span>&nbsp;</span>Staff<p><a href="javascript:;">Open Plugins</a></p></h2>
        <nav>
        	<ul>
            	<li><a href="staff.php"><span>スタッフ検索</span></a></li>
            	<li><a href="staff.php?op=regist"><span>スタッフ登録</span></a></li>
            	<li class="active"><a href="{$smarty.server.SCRIPT_NAME}"><span>ロール検索</span></a></li>
            	<li><a href="{$smarty.server.SCRIPT_NAME}?op=regist"><span>ロール登録</span></a></li>
                </ul>
        </nav>
        
        <section id="content">
        
        	<h3>ロール検索</h3>
                    
                    <div id="search_form">
                    	<form name="form1" method="post" action="{$smarty.server.SCRIPT_NAME}">
                    	    <dl>
                    	        <dt>サイト</dt>
                    	        <dd>
                                    <select name="search[site_id]">
                                    {html_options options=$site_list selected=$forms.site_id}
                                    </select>
                    	        </dd>
                    	    </dl>
                    	    <dl>
                    	        <dt>ロール名</dt>
                    	        <dd>
                    	            <input type="text" name="search[name]" value="{$forms.name|escape}" />　
                    	        </dd>
                    	    </dl>
                    	    <p class="search_submit">
                    	        <button type="submit" class="submit"><span>検索</span></button>
                    	    </p>
                            <input type="hidden" name="page_id" value=""/>
                    	</form>
                    </div>

                
                    {if isset($pager->info.all)}<p class="message">
                        {$pager->info.all|number_format}件登録されています。</p>
                    {/if}
		
                    {if isset($pager->info.all) && $pager->info.all > 0}
                        <table id="search_result" class="sortable">
                                <thead>
                                    <tr>
                                        <th>ID</th>
                                        <th>状態</th>
                                        <th>ロール名</th>
                                        <th>登録日時</th>
                                        <th>更新日時</th>
                                        <th>更新</th>
                                    </tr>
                                </thead>
                                <tbody>
                                {foreach from=$list key=k item=v}
                                    <tr>
                                        <td>{"%05d"|sprintf:$v.id}</td>
                                        <td class="staff_status">{if $v.actived == '1'}利用中{else}停止{/if}</td>
                                        <td class="td_name"><a href="{$smarty.server.SCRIPT_NAME}?op=edit&id={$v.id|escape}">{$v.name|escape}</a></td>
                                        <td>{$v.r_date|escape}</td>
                                        <td>{$v.u_date|escape}</td>
                                        <td class="update"><a href="{$smarty.server.SCRIPT_NAME}?op=edit&id={$v.id|escape}">更新</a></td>
                                    </tr>
                                {/foreach}
                                </tbody>
                        </table>
                    {/if}	

        </section>
    </article>
    
</div>

{include file='include/footer.inc.html'}

<script language="JavaScript">
function pager(n){
	var obj = document.staff_index;
	obj.page_id.value = n;
	obj.submit();
}
</script>

</body>
</html>